package com.crpc.common.constant;

import java.nio.charset.StandardCharsets;

/**
 * @author wzy
 * @version 1.0
 * @description:
 * @date 2023/9/26 15:16
 */
public class MessageFormatConstant {
    public final static byte[] MAGIC = "crpc".getBytes(StandardCharsets.UTF_8);
    public final static byte VERSION = 1;
    //版本信息的长度
    public final static int VERSION_LENGTH = 1;
    //头部长度 规定了两个字节
    public final static short HEADER_LENGTH = (short) (MAGIC.length + 1 + 2 + 4 + 1 + 1 + 1 + 8 + 8);
    //头部长度占用的字节数
    //总长度占用的字节数
    public final static int FULL_FIELD_Length = 4;
    public final static short HEADER_FIELD_LENGTH = 2;
    //最大帧长 超过会直接丢弃
    public final static int MaxFrameLength = 1024 * 1024;


}
